Skip to content

fix(hub-ui): open the command palette from Messages - #505

Open
SaKaNa-Y wants to merge 2 commits into
devframes:mainfrom
SaKaNa-Y:fix/messages-palette-shortcut
Open

SaKaNa-Y wants to merge 2 commits into
devframes:mainfrom
SaKaNa-Y:fix/messages-palette-shortcut

Conversation

@SaKaNa-Y

@SaKaNa-Y SaKaNa-Y commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Clicking message text gives the Messages iframe keyboard focus in both the embedded and standalone viewers.

 Click message text, then press the configured palette shortcut once.
- The command palette stays closed.
+ The command palette opens with its search field focused.

When the Messages search field has focus, it keeps the keystroke.

Evidence

  • Before: In Chrome, Cmd+K opened the palette from the surrounding page. After clicking message text, the palette stayed closed in both viewers.
    After: Cmd+K opened the palette from Messages in both viewers. Selecting a command with Return ran it once. The Messages search field kept focus when it received the same shortcut.

  • Before: Rebinding the palette to Cmd+Shift+Y still left it unreachable from Messages.
    After: The custom binding opened the palette in both viewers, and clearing it disabled the shortcut. When the palette and a plugin shared a binding, holding it from Messages made zero plugin calls. A fresh press from the viewer made one.

  • Before: If K was released and pressed again in an iframe, its next repeat could leave a host text field empty. Holding the palette binding Alt+Shift+D from Messages could also hide the embedded dock.
    After: The host field received k after release in either Messages or another iframe. Holding Alt+Shift+D kept the palette open. A fresh press still toggled the dock. All four Chrome regression cases passed three consecutive runs.

Merge Danger

Door: Two-way. Reverting restores the previous keyboard behavior. Shortcut settings keep their format.

Blast Radius: Keyboard. The embedded and standalone viewers share the shortcut listener. The change depends on recognizing which key started in Messages when focus moves to the palette.

Clicks on message text leave focus in the Messages iframe. Listen for its configured palette shortcut there and let focused controls handle their own keys.

Consume repeats from the same physical press after focus enters the viewer. A fresh press still uses the viewer's regular command order when two commands share a binding.
@vercel

vercel Bot commented Nov 21, 2026

Copy link
Copy Markdown

@SaKaNa-Y is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

👁️‍🗨️ Review this pull request with grouped, summarized diffs at:
👉 https://pulls.review/gh/devframes/devframe/505?from=github-actions[bot]

raw result

💭 analyzed by vercel-ai-gateway/anthropic/claude-sonnet-5
🕰️ 2026-11-22 08:07 UTC
🔗 head 3197d31
🤖 automated by pulls.review

{
  "headSha": "3197d310e71ba978bc02ef55f88fbae1ddef9b70",
  "result": {
    "overallSummary": "Fixes a bug where clicking into the Messages panel (embedded or standalone) swallowed keyboard shortcuts such as the command palette toggle, because focus moved into the Messages iframe's document. The fix identifies the Messages iframe body, listens for its key events, and reconciles \"held\" shortcut keys across windows so the palette opens exactly once and keeps receiving repeats/releases correctly even when a command shares the same binding. Covered by a new e2e test suite.",
    "groups": [
      {
        "key": "palette-messages-fix",
        "label": "Palette shortcut from Messages",
        "summary": "Fixes the command palette (and other global shortcuts) being unreachable from the Messages panel by tracking a dedicated body id for the Messages iframe, forwarding its keydown/keyup events to a new shortcut handler, and tracking a \"held\" key per host so a repeat that started in Messages keeps hitting the focused palette/search field instead of re-triggering commands, while releases/new presses across windows are reconciled via blur listeners.",
        "category": "core",
        "filePaths": [
          "packages/hub-ui/src/client/constants.ts",
          "packages/hub-ui/src/client/components/views/ViewIframe.vue",
          "packages/hub-ui/src/client/state/commands.ts",
          "packages/hub-ui/src/client/state/context.ts",
          "plugins/messages/app/index.html"
        ],
        "critical": true,
        "fileNotes": [
          {
            "path": "packages/hub-ui/src/client/state/commands.ts",
            "text": "Core of the fix: `handleMessagesPaletteShortcut` opens the palette from inside Messages, and `setupShortcutListener`/`updateHeldMessagesKey` track held keys per window so repeats don't double-trigger commands when focus moves between the palette and Messages.",
            "critical": true
          },
          {
            "path": "plugins/messages/app/index.html",
            "text": "Adds the `devframes-messages` body id that `ViewIframe.vue` relies on to detect the Messages iframe and attach the keyboard listener."
          }
        ]
      },
      {
        "key": "e2e-tests",
        "label": "E2E tests for palette shortcut",
        "summary": "Adds Playwright coverage for opening the palette from Messages, avoiding duplicate command execution when a shortcut is shared with another command, and correctly handling key releases across Messages, other iframes, and the host page.",
        "category": "tests",
        "filePaths": [
          "tests/e2e/messages-palette.spec.ts"
        ],
        "critical": true
      }
    ],
    "schemaVersion": 1,
    "source": "llm",
    "generatedAt": "2026-11-22T08:07:12.279Z",
    "model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
    "locale": "en"
  }
}

A release inside an iframe could leave the viewer suppressing a later press of the same key. Track releases in Messages and clear the gesture when the viewer window loses focus.

Consume repeats of the opening key before the embedded dock visibility listener can act on the same event. Cover both release locations and a palette binding shared with the dock shortcut in Chromium.
@SaKaNa-Y
SaKaNa-Y marked this pull request as ready for review November 22, 2026 08:16

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant